package com.twu.biblioteca;

public class Movie {

    private String name;
    private int year;
    private String director;
    private String rating;

    public Movie(String name, int year, String director, String rating) {
        this.name = name;
        this.year = year;
        this.director = director;
        this.rating = rating;
    }

    public String getName() {
        return name;
    }

    public int getYear() {
        return year;
    }

    public String getDirector() {
        return director;
    }

    public String getRating() {
        return rating;
    }

    public String toString() {
        return getName() + " " + getYear() + " " + getDirector() + " " + getRating() + "\n";
    }

    @Override
    public boolean equals(Object o) {
        Movie movie = (Movie) o;
        return this.name.equals(movie.getName())
                && this.year == movie.getYear()
                && this.director.equals(movie.getDirector())
                && this.rating.equals(movie.getRating());

    }
}
